<%@page import="java.io.File"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Music search</title>
</head>
	<body>
	Répertoire racine : <c:out value="${initParam.rootDir}"></c:out>
	<br />
	Répertoire courant : <c:out value="${currentFolder.absolutePath}"></c:out>
	<br />
	
	<form name="input" action="SearchMusic" method="get">	
Rechercer rapide <input type="text" name="searchString"><input type="submit" value="Submit">
</form>	
	
	<h1>Répertoires</h1>
	<ul>
	<c:forEach items="${folders}" var="vFolder">
		<c:url var="vListContentUrl" value="/ListContentServlet">
			<c:param name="folder" value="${vFolder.absolutePath}"></c:param>
		</c:url>
		<li><a href="${vListContentUrl}">${vFolder.name}</a>	
	</c:forEach>
	</ul>
	
	<h1>Fichiers</h1>
	<ul>
	
	<c:forEach items="${files}" var="vFile">
	<c:url var="vListContentUrl_file" value="/SendMusic">
			<c:param name="file" value="${vFile.absolutePath}"></c:param>
		</c:url>	
		<li><a href="${vListContentUrl_file}">${vFile.name}</a>	
	</c:forEach>
	
	</ul>
		
	</body>
</html>